package org.benetech.collections;

/**
 * Key / value pair.
 * @author Reuben Firmin
 *
 * @param <T> The key
 * @param <U> The value
 */
public final class TreeMetadata<T, U> {
	private T key;
	private U value;

	/**
	 * Construct.
	 * @param key never null
	 * @param value never null
	 */
	public TreeMetadata(final T key, final U value) {
		this.key = key;
		this.value = value;
	}

	/**
	 * Return the key.
	 * @return never null
	 */
	public T getKey() {
		return key;
	}

	/**
	 * Set the key.
	 * @param key never null
	 */
	public void setKey(final T key) {
		this.key = key;
	}

	/**
	 * Get the value.
	 * @return never null
	 */
	public U getValue() {
		return value;
	}

	/**
	 * Set the value.
	 * @param value never null
	 */
	public void setValue(final U value) {
		this.value = value;
	}

	/**
	 * {@inheritDoc}
	 */
	public String toString() {
		return value.toString();
	}

}
